﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Fintech.Utils;
using ZOVNP.Model;
using ZOVNP.Model.Abstracts;

namespace ZOVNP.WinView
{
    [Argument.NameAttribute("SellerWorkplace")]
    [DisplayName("Продавец")]
    [Description("Рабочее место продавца")]
    class SellerWorkplace : IWorkplace
    {
        private SellerMainControl _mainControl;
        public SellerWorkplace(IEngine engine)
        {
            Engine = engine;
        }

        public IEngine Engine { get; private set; }

        public void PopulateMainContainer(Control container)
        {
            _mainControl = new SellerMainControl(new Workspace((IDomainEngine)Engine));
            _mainControl.Dock = DockStyle.Fill;
            container.Controls.Add(_mainControl);
        }

        public void Save()
        {
            _mainControl.Save();
        }


        public void Add()
        {
            _mainControl.Add();
        }

        public void Edit()
        {
            _mainControl.Edit();
        }

        public void Delete()
        {
            _mainControl.Delete();
        }

        public void Refresh()
        {
            _mainControl.Refresh();
        }

        public void Print()
        {
            _mainControl.Print();
        }
    }
}
